
'''import json#简单数据类型
info = {
    'name':'ouyang',
    'age':22,
}

f = open('a.txt','w')
# f.write(str(info))

# print(json.dumps((info)))
f.write(json.dumps((info)))
f.close()'''

import pickle#所有数据类型

def say(name):
    print('hello',name)

info = {
    'name':'ouyang',
    'age':22,
    'func':say  #内存地址
}
f = open('a.txt', 'wb')
print(pickle.dumps(info) )
f.write(pickle.dumps(info) )
f.close()


